package com.example.personnel_management_system.service.Impl;

import com.example.personnel_management_system.entity.Salary;
import com.example.personnel_management_system.mapper.SalaryMapper;
import com.example.personnel_management_system.service.ISalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
@Service
public class SalaryServiceImpl implements ISalaryService {
    @Autowired
    private SalaryMapper salaryMapper;
    @Override
    public void insert(Salary salary,Integer uID) {
        salary.setsRecordDate(new Date());
        salary.setSproducer(uID);
        salaryMapper.insert(salary);
    }


    @Override
    public void update(Salary salary,Integer uID) {
        salary.setsRecordDate(new Date());
        salary.setSproducer(uID);
        salaryMapper.update(salary);
    }

    @Override
    public List<Salary> findall() {
        return salaryMapper.findall();
    }

    @Override
    public List<Salary> findBysStatus(Integer sStatus) {
        return salaryMapper.findBysStatus(sStatus);
    }

    @Override
    public Salary findBysID(Integer sID) {
        return salaryMapper.findBysID(sID);
    }

    @Override
    public Integer delete(Integer sID) {
        return salaryMapper.delete(sID);
    }
}
